/*
 * Copyright (C) 2023 Intel Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sub license, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 * 
 * Device ids are available in linux kernel source tree and Intel website.
 * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/drm/i915_pciids.h
 * https://dgpu-docs.intel.com/devices/hardware-table.html
 */

#ifndef _IGD_PCIIDS_H_
#define _IGD_PCIIDS_H_

#include <stdint.h>

struct igd_device {
	uint16_t device;
	int gen;
};

#define IGD_DEVICE_ENTRY(id, gen)	\
	{ id, gen }


/* Skylake, Gen 9 */
#define IGD_SKL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x1906, 9),	\
	IGD_DEVICE_ENTRY(0x1913, 9),	\
	IGD_DEVICE_ENTRY(0x190E, 9),	\
	IGD_DEVICE_ENTRY(0x1915, 9),	\
	IGD_DEVICE_ENTRY(0x1902, 9),	\
	IGD_DEVICE_ENTRY(0x190A, 9),	\
	IGD_DEVICE_ENTRY(0x190B, 9),	\
	IGD_DEVICE_ENTRY(0x1917, 9),	\
	IGD_DEVICE_ENTRY(0x1916, 9),	\
	IGD_DEVICE_ENTRY(0x1921, 9),	\
	IGD_DEVICE_ENTRY(0x191E, 9),	\
	IGD_DEVICE_ENTRY(0x1912, 9),	\
	IGD_DEVICE_ENTRY(0x191A, 9),	\
	IGD_DEVICE_ENTRY(0x191B, 9),	\
	IGD_DEVICE_ENTRY(0x191D, 9),	\
	IGD_DEVICE_ENTRY(0x1923, 9),	\
	IGD_DEVICE_ENTRY(0x1926, 9),	\
	IGD_DEVICE_ENTRY(0x1927, 9),	\
	IGD_DEVICE_ENTRY(0x192A, 9),	\
	IGD_DEVICE_ENTRY(0x192B, 9),	\
	IGD_DEVICE_ENTRY(0x192D, 9),	\
	IGD_DEVICE_ENTRY(0x1932, 9),	\
	IGD_DEVICE_ENTRY(0x193A, 9),	\
	IGD_DEVICE_ENTRY(0x193B, 9),	\
	IGD_DEVICE_ENTRY(0x193D, 9)

/* Apollo Lake, Gen 9 */
#define IGD_BXT_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x0A84, 9),	\
	IGD_DEVICE_ENTRY(0x1A84, 9),	\
	IGD_DEVICE_ENTRY(0x1A85, 9),	\
	IGD_DEVICE_ENTRY(0x5A84, 9),	\
	IGD_DEVICE_ENTRY(0x5A85, 9)

/* Gemini Lake, Gen 9 */
#define IGD_GLK_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x3184, 9),	\
	IGD_DEVICE_ENTRY(0x3185, 9)

/* Kaby Lake, Gen 9 */
#define IGD_KBL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x5906, 9),	\
	IGD_DEVICE_ENTRY(0x5913, 9),	\
	IGD_DEVICE_ENTRY(0x590E, 9),	\
	IGD_DEVICE_ENTRY(0x5915, 9),	\
	IGD_DEVICE_ENTRY(0x5902, 9),	\
	IGD_DEVICE_ENTRY(0x5908, 9),	\
	IGD_DEVICE_ENTRY(0x590A, 9),	\
	IGD_DEVICE_ENTRY(0x590B, 9),	\
	IGD_DEVICE_ENTRY(0x5916, 9),	\
	IGD_DEVICE_ENTRY(0x5921, 9),	\
	IGD_DEVICE_ENTRY(0x591E, 9),	\
	IGD_DEVICE_ENTRY(0x5912, 9),	\
	IGD_DEVICE_ENTRY(0x5917, 9),	\
	IGD_DEVICE_ENTRY(0x591A, 9),	\
	IGD_DEVICE_ENTRY(0x591B, 9),	\
	IGD_DEVICE_ENTRY(0x591D, 9),	\
	IGD_DEVICE_ENTRY(0x5926, 9),	\
	IGD_DEVICE_ENTRY(0x5923, 9),	\
	IGD_DEVICE_ENTRY(0x5927, 9),	\
	IGD_DEVICE_ENTRY(0x593B, 9),	\
	IGD_DEVICE_ENTRY(0x591C, 9),	\
	IGD_DEVICE_ENTRY(0x87C0, 9)

/* Coffee Lake/Comet Lake, Gen 9 */
#define IGD_CFL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x87CA, 9),	\
	IGD_DEVICE_ENTRY(0x9BA2, 9),	\
	IGD_DEVICE_ENTRY(0x9BA4, 9),	\
	IGD_DEVICE_ENTRY(0x9BA5, 9),	\
	IGD_DEVICE_ENTRY(0x9BA8, 9),	\
	IGD_DEVICE_ENTRY(0x9B21, 9),	\
	IGD_DEVICE_ENTRY(0x9BAA, 9),	\
	IGD_DEVICE_ENTRY(0x9BAC, 9),	\
	IGD_DEVICE_ENTRY(0x9BC2, 9),	\
	IGD_DEVICE_ENTRY(0x9BC4, 9),	\
	IGD_DEVICE_ENTRY(0x9BC5, 9),	\
	IGD_DEVICE_ENTRY(0x9BC6, 9),	\
	IGD_DEVICE_ENTRY(0x9BC8, 9),	\
	IGD_DEVICE_ENTRY(0x9BE6, 9),	\
	IGD_DEVICE_ENTRY(0x9BF6, 9),	\
	IGD_DEVICE_ENTRY(0x9B41, 9),	\
	IGD_DEVICE_ENTRY(0x9BCA, 9),	\
	IGD_DEVICE_ENTRY(0x9BCC, 9),	\
	IGD_DEVICE_ENTRY(0x3E90, 9),	\
	IGD_DEVICE_ENTRY(0x3E93, 9),	\
	IGD_DEVICE_ENTRY(0x3E99, 9),	\
	IGD_DEVICE_ENTRY(0x3E91, 9),	\
	IGD_DEVICE_ENTRY(0x3E92, 9),	\
	IGD_DEVICE_ENTRY(0x3E96, 9),	\
	IGD_DEVICE_ENTRY(0x3E98, 9),	\
	IGD_DEVICE_ENTRY(0x3E9A, 9),	\
	IGD_DEVICE_ENTRY(0x3E9C, 9),	\
	IGD_DEVICE_ENTRY(0x3E94, 9),	\
	IGD_DEVICE_ENTRY(0x3E9B, 9),	\
	IGD_DEVICE_ENTRY(0x3EA9, 9),	\
	IGD_DEVICE_ENTRY(0x3EA5, 9),	\
	IGD_DEVICE_ENTRY(0x3EA6, 9),	\
	IGD_DEVICE_ENTRY(0x3EA7, 9),	\
	IGD_DEVICE_ENTRY(0x3EA8, 9),	\
	IGD_DEVICE_ENTRY(0x3EA1, 9),	\
	IGD_DEVICE_ENTRY(0x3EA4, 9),	\
	IGD_DEVICE_ENTRY(0x3EA0, 9),	\
	IGD_DEVICE_ENTRY(0x3EA3, 9),	\
	IGD_DEVICE_ENTRY(0x3EA2, 9)

/* Ice Lake, Gen 11 */
#define IGD_ICL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x8A50, 11),	\
	IGD_DEVICE_ENTRY(0x8A52, 11),	\
	IGD_DEVICE_ENTRY(0x8A53, 11),	\
	IGD_DEVICE_ENTRY(0x8A54, 11),	\
	IGD_DEVICE_ENTRY(0x8A56, 11),	\
	IGD_DEVICE_ENTRY(0x8A57, 11),	\
	IGD_DEVICE_ENTRY(0x8A58, 11),	\
	IGD_DEVICE_ENTRY(0x8A59, 11),	\
	IGD_DEVICE_ENTRY(0x8A5A, 11),	\
	IGD_DEVICE_ENTRY(0x8A5B, 11),	\
	IGD_DEVICE_ENTRY(0x8A5C, 11),	\
	IGD_DEVICE_ENTRY(0x8A70, 11),	\
	IGD_DEVICE_ENTRY(0x8A71, 11),	\
	IGD_DEVICE_ENTRY(0x8A51, 11),	\
	IGD_DEVICE_ENTRY(0x8A5D, 11)

/* Elkhart Lake, Gen 12 */
#define IGD_EHL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x4541, 12),	\
	IGD_DEVICE_ENTRY(0x4551, 12),	\
	IGD_DEVICE_ENTRY(0x4555, 12),	\
	IGD_DEVICE_ENTRY(0x4557, 12),	\
	IGD_DEVICE_ENTRY(0x4570, 12),	\
	IGD_DEVICE_ENTRY(0x4571, 12)

/* Jasper Lake, Gen 12 */
#define IGD_JSL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x4E51, 12),	\
	IGD_DEVICE_ENTRY(0x4E55, 12),	\
	IGD_DEVICE_ENTRY(0x4E57, 12),	\
	IGD_DEVICE_ENTRY(0x4E61, 12),	\
	IGD_DEVICE_ENTRY(0x4E71, 12)

/* Tiger Lake, Gen 12 */
#define IGD_TGL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x9A60, 12),	\
	IGD_DEVICE_ENTRY(0x9A68, 12),	\
	IGD_DEVICE_ENTRY(0x9A70, 12),	\
	IGD_DEVICE_ENTRY(0x9A40, 12),	\
	IGD_DEVICE_ENTRY(0x9A49, 12),	\
	IGD_DEVICE_ENTRY(0x9A59, 12),	\
	IGD_DEVICE_ENTRY(0x9A78, 12),	\
	IGD_DEVICE_ENTRY(0x9AC0, 12),	\
	IGD_DEVICE_ENTRY(0x9AC9, 12),	\
	IGD_DEVICE_ENTRY(0x9AD9, 12),	\
	IGD_DEVICE_ENTRY(0x9AF8, 12)

/* Rocket Lake, Gen 12 */
#define IGD_RKL_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x4C80, 12),	\
	IGD_DEVICE_ENTRY(0x4C8A, 12),	\
	IGD_DEVICE_ENTRY(0x4C8B, 12),	\
	IGD_DEVICE_ENTRY(0x4C8C, 12),	\
	IGD_DEVICE_ENTRY(0x4C90, 12),	\
	IGD_DEVICE_ENTRY(0x4C9A, 12)

/* Alder Lake-S, Gen 12 */
#define IGD_ADLS_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x4680, 12),	\
	IGD_DEVICE_ENTRY(0x4682, 12),	\
	IGD_DEVICE_ENTRY(0x4688, 12),	\
	IGD_DEVICE_ENTRY(0x468A, 12),	\
	IGD_DEVICE_ENTRY(0x468B, 12),	\
	IGD_DEVICE_ENTRY(0x4690, 12),	\
	IGD_DEVICE_ENTRY(0x4692, 12),	\
	IGD_DEVICE_ENTRY(0x4693, 12)

/* Alder Lake-P, Gen 12 */
#define IGD_ADLP_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x46A0, 12),	\
	IGD_DEVICE_ENTRY(0x46A1, 12),	\
	IGD_DEVICE_ENTRY(0x46A2, 12),	\
	IGD_DEVICE_ENTRY(0x46A3, 12),	\
	IGD_DEVICE_ENTRY(0x46A6, 12),	\
	IGD_DEVICE_ENTRY(0x46A8, 12),	\
	IGD_DEVICE_ENTRY(0x46AA, 12),	\
	IGD_DEVICE_ENTRY(0x462A, 12),	\
	IGD_DEVICE_ENTRY(0x4626, 12),	\
	IGD_DEVICE_ENTRY(0x4628, 12),	\
	IGD_DEVICE_ENTRY(0x46B0, 12),	\
	IGD_DEVICE_ENTRY(0x46B1, 12),	\
	IGD_DEVICE_ENTRY(0x46B2, 12),	\
	IGD_DEVICE_ENTRY(0x46B3, 12),	\
	IGD_DEVICE_ENTRY(0x46C0, 12),	\
	IGD_DEVICE_ENTRY(0x46C1, 12),	\
	IGD_DEVICE_ENTRY(0x46C2, 12),	\
	IGD_DEVICE_ENTRY(0x46C3, 12)

/* Alder Lake-N, Gen 12 */
#define IGD_ADLN_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0x46D0, 12),	\
	IGD_DEVICE_ENTRY(0x46D1, 12),	\
	IGD_DEVICE_ENTRY(0x46D2, 12)

/* Raptor Lake-S, Gen 12 */
#define IGD_RPLS_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0xA780, 12),	\
	IGD_DEVICE_ENTRY(0xA781, 12),	\
	IGD_DEVICE_ENTRY(0xA782, 12),	\
	IGD_DEVICE_ENTRY(0xA783, 12),	\
	IGD_DEVICE_ENTRY(0xA788, 12),	\
	IGD_DEVICE_ENTRY(0xA789, 12),	\
	IGD_DEVICE_ENTRY(0xA78A, 12),	\
	IGD_DEVICE_ENTRY(0xA78B, 12)

/* Raptor Lake-P, Gen 12 */
#define IGD_RPLP_DEVICE_IDS	\
	IGD_DEVICE_ENTRY(0xA721, 12),	\
	IGD_DEVICE_ENTRY(0xA7A1, 12),	\
	IGD_DEVICE_ENTRY(0xA7A9, 12),	\
	IGD_DEVICE_ENTRY(0xA720, 12),	\
	IGD_DEVICE_ENTRY(0xA7A0, 12),	\
	IGD_DEVICE_ENTRY(0xA7A8, 12)

#endif
